package response

import "net/http"

//数据请求类型
type Response struct {
	httpRes *http.Response //http相应
	depth   uint32         // 请求深度
}

//创建一个数据请求实体
func NewRes(httpRes *http.Response, depth uint32) *Response {
	return &Response{httpRes: httpRes, depth: depth}
}

//获取HTTP请求
func (res *Response) GetHttpReq() *http.Response {
	return res.httpRes
}

//获取请求深度
func (res *Response) GetDepth() uint32 {
	return res.depth
}

//返回的有效性
func (res *Response) Valid() bool {
	return res.httpRes != nil && res.httpRes.Body != nil
}
